package com.example.databasepj.mapper;

import com.example.databasepj.dtoAdvanced.*;
import com.example.databasepj.entity.OrderEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderMapper {
    //插入order,返回生成的order_id
    int insertOrder(OrderEntity orderEntity);
    List<OrderEntity> selectOrderByUserID(int user_ID);
    List<OrderEntity> selectOrderByMerchantID(int merchantID);

    List<Integer> selectDistinctUserbyMerchant(int merchantID);
    OrderEntity selectOrderByOrderID(int orderID);

    void updateOrder_status(int id,int order_status);

    List<FansMiddleData> selectFans(FansMiddleRequest request);

    List<FansConsumptionResponse> getFansConsumption(FansConsumptionMiddleRequest request);

    List<OrderCountWeekly> countOrderWeekly(int year);
    List<OrderCountMonthly> countOrderMonthly(int year);
    List<OrderCountHourly> countOrdersByHour(int year);

    Integer countByMerchant_idAndUser_id(int merchantID, int userID);


}
